import Vue from 'vue/dist/vue.esm';
import VueRouter from 'vue-router';
Vue.use(VueRouter);

import test1 from '../components/test.vue';

const Foo = { template: '<div>foo</div>' }
const Bar = { template: '<div>bar</div>' }

const routes = [
  { path: '/', component: test1 },
  { path: '/login', component: () => import('../views/login/index'), hidden: true },
  { path: '/bar', component: Bar },
  { path: '/foo', component: Foo }
]

const router = new VueRouter({
  mode: 'history',
  routes // (缩写) 相当于 routes: routes
})

export default router;
